home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / init.d / polipo < prev    next >
Encoding:
Text File  |  2013-01-10  |  1.7 KB  |  80 lines

  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          polipo
  4. # Required-Start:    $remote_fs
  5. # Required-Stop:     $remote_fs
  6. # Default-Start:     2 3 4 5
  7. # Default-Stop:
  8. # Short-Description: Start or stop the polipo web cache
  9. ### END INIT INFO
  10. #
  11. # Author:    Tom Ellis Huckstep <tom-debian-polipo@jaguarpaw.co.uk>
  12. #
  13.  
  14. set -e
  15.  
  16. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  17.  
  18. PPCTL=/usr/lib/polipo/polipo-control
  19. test -x $PPCTL  || exit 0
  20.  
  21. NAME=polipo
  22. DESC=polipo
  23.  
  24. # Include polipo defaults if available
  25. #if [ -f /etc/default/polipo ] ; then
  26. #    . /etc/default/polipo
  27. #fi
  28.  
  29. # Make sure /var/run/polipo exists.
  30. if [ ! -e /var/run/$NAME ] ; then
  31.     mkdir -p /var/run/$NAME
  32.     chown proxy:proxy /var/run/$NAME
  33.     chmod 755 /var/run/$NAME
  34. fi
  35.  
  36. case "$1" in
  37.   start)
  38.     echo -n "Starting $DESC: "
  39.         $PPCTL start
  40.     echo "$NAME."
  41.     ;;
  42.   stop)
  43.     echo -n "Stopping $DESC: "
  44.         $PPCTL stop
  45.     echo "$NAME."
  46.     ;;
  47.   #reload)
  48.     #
  49.     #    If the daemon can reload its config files on the fly
  50.     #    for example by sending it SIGHUP, do it here.
  51.     #
  52.     #    If the daemon responds to changes in its config file
  53.     #    directly anyway, make this a do-nothing entry.
  54.     #
  55.     # echo "Reloading $DESC configuration files."
  56.     # start-stop-daemon --stop --signal 1 --quiet --pidfile \
  57.     #    /var/run/$NAME.pid --exec $DAEMON
  58.   #;;
  59.   restart|force-reload)
  60.     #
  61.     #    If the "reload" option is implemented, move the "force-reload"
  62.     #    option to the "reload" entry above. If not, "force-reload" is
  63.     #    just the same as "restart".
  64.     #
  65.     echo -n "Restarting $DESC: "
  66.         $PPCTL stop
  67.     sleep 1
  68.         $PPCTL start
  69.     echo "$NAME."
  70.     ;;
  71.   *)
  72.     N=/etc/init.d/$NAME
  73.     # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
  74.     echo "Usage: $N {start|stop|restart|force-reload}" >&2
  75.     exit 1
  76.     ;;
  77. esac
  78.  
  79. exit 0
  80.